const dbconfig = {
    production: {
        MYSQL: {
            DATABASE: 'te5', //数据库名称
            USERNAME: 'root', //mysql用户名
            PASSWORD: 'lichu', //mysql密码
            PORT: '3306', //mysql端口号
            HOST: '192.168.1.10', //服务器ip
            DIALECT: "mysql", // orm 支持数据库
            POOL: {  // 连接池
                max: 5,
                min: 0,
                acquire: 30000,
                idle: 10000
            }  
        },
        REDIS: {
            HOST: 'localhost',            
            PORT: 6379,
            PASSWORD: "abcd",
            MAXAGE: 3600000
        }
    },
    development: {
        MYSQL: {
            DATABASE: 'eggdata', //数据库名称
            USERNAME: 'root', //mysql用户名
            PASSWORD: 'root', //mysql密码
            PORT: '3306', //mysql端口号
            HOST: 'localhost', //服务器ip
            DIALECT: "mysql", // orm 支持数据库
            POOL: { // 连接池
                max: 5,
                min: 0,
                acquire: 30000,
                idle: 10000
            }  
        },
        REDIS: {
            HOST: 'localhost',            
            PORT: 6379,
            PASSWORD: "abcd",
            MAXAGE: 3600000
        }
    }
}

const ENV = process.env.NODE_ENV || 'development';
console.log("环境变量：", ENV)

module.exports = dbconfig[ENV];
